﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace LightCAD.Core
{
    public class LcBuilding : LcObject
    {
        public string Uuid { get; set; }
        public string Name { get; set; }
        public LcLevelCollection Levels { get; set; }= new LcLevelCollection();

        public override void ReadObjectRefs<T>(ICollection<T> objs)
        {
            base.ReadObjectRefs(objs);
            foreach (var lvl in this.Levels)
            {
                lvl.ReadObjectRefs(objs);
            }
        }
    }

    public class BuildingCollection : KeyedCollection<long, LcBuilding>
    {
        protected override long GetKeyForItem(LcBuilding item)
        {
            return item.Id;
        }
    }
}